import { rcaNumberFormat0,rcaNumberFormat00 } from './common.js'
import { dateFormat } from '@/util/date'
import { commonTableOption } from './common.js'
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
export const endDate = dateFormat(new Date(), 'yyyy-MM-dd');
export const tableOption = {
  ...commonTableOption,
  height: '400px',
  column: [
    {
      hide: true,
      search: true,
      type: 'date',
      label: '日期范围',
      prop: 'tradeDate',
      searchSpan: 12,
      searchRange: true,
      searchValue: [],
      format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
      valueFormat: 'yyyy-MM-dd',
    },
    {
      hide: true,
      search: false,
      type: 'select',
      label: '运营商',
      props: {
        label: 'operatorsName',
        value: 'operators'
      },
      dicUrl: '/rca/swckclearrules/listoperators',
      prop: 'operators'
    },
    {
      hide: true,
      search: false,
      type: 'select',
      label: '线路',
      prop: 'lineCode',
      dicQuery: { allLine: true },
      dicUrl: '/support/swparamline/dictsecondname',
      props: {
        label: 'name',
        value: 'code'
      },
    },
    {
      type: 'input',
      label: '运营商',
      prop: 'operatorsName',
    },
    {
      type: 'input',
      label: '线路',
      width:'120px',
      prop: 'lineName',
    },
    {
      label: '单程票清分',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '实收',
          prop: 'paidinOnewaySum'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '应收',       
          prop: 'receivableOnewaySum'
        }, {
          label: '应付',
          children: [
            {
              type: 'input',
              showSummary: true,
              precision: 7,
              width:'150px',
              formatter: (row, value, label, column) => {
                return rcaNumberFormat0(value)
              },
              label: 'ACC清分结果',
              prop: 'receivableOnewayAccSum'
            }, {
              type: 'input',
              showSummary: true,
              precision: 7,
              width:'150px',
              formatter: (row, value, label, column) => {
                return rcaNumberFormat0(value)
              },
              label: '协议清分',
              prop: 'receivableOnewayAgreeClean'
            },
          ]
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '实收清分结果',
          prop: 'receivableOnewayReceivedClean'
        },
      ]
    },
    {
      label: '其他车票',
      children:
        [{
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '计次票',
          prop: 'countingTicket'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '日票',
          prop: 'dailyTicket'         
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '纪念票',
          prop: 'commemorativeTicket'
        },
        ]
    },
    {
      label: '长安通',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '系统清分',
          prop: 'catSystemClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '协议清分',
          prop: 'catAgreeClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '小计',
          prop: 'catSubtotal'
        },
      ]
    },
    {
      label: '交通卡',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '系统清分',
          prop: 'trafficCardSystemClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '协议清分',
          prop: 'trafficCardAgreeClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '小计',
          prop: 'trafficCardCatSubtotal'
        },

      ]
    },
    {
      label: '电子二维码',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7, 
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '消费出闸',
          prop: 'qrCodeSubTotal'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '系统清分',
          prop: 'systemClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '协议清分',
          prop: 'qrCodeTicketAgreeClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '小计',
          prop: 'qrSubtotal'
        },
      ]
    },
    {
      label: '人脸',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '建行',
          prop: 'faceTicketCcb'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '系统清分',
          prop: 'faceTicketSystemClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
	        width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '协议清分',
          prop: 'faceTicketAgreeClean'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
		      width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '小计',
          prop: 'faceSubtotal'
        },
      ]
    },
    {
      type: 'input',
      showSummary: true,
      precision: 7,
	    width:'150px',
      formatter: (row, value, label, column) => {
        return rcaNumberFormat0(value)
      },
      label: '收入小计',
      prop: 'incomeSubtotal'
    }, {
      type: 'input',
      showSummary: true,
      precision: 7,
	    width:'150px',
      formatter: (row, value, label, column) => {
        return rcaNumberFormat0(value)
      },
      label: '系统清分结果小计',
      prop: 'systemCleanSum'
    }, {
      type: 'input',
      width:'150px',
      label: '系统清分收入比例',
      prop: 'systemCleanSumRatio'
    },
    {
      label: '单程票',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '实收-应收',
          prop: 'paidinReceivable'
        }, {
          type: 'input',
          showSummary: true,
          precision: 7,
          width:'150px',
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
          label: '应收-应付',
          prop: 'receivableAcc'
        }
      ]
    }

  ]
}
